<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_marginHorizontal="@dimen/default_margins"
    android:orientation="vertical"
    tools:context=".ui.screens.profile.ProfileFragment">

    <androidx.core.widget.NestedScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal">

                <TextView
                    style="@style/film_category_name"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="3"
                    android:ellipsize="end"
                    android:maxLines="1"
                    android:text="@string/watched" />

                <Button
                    android:id="@+id/showAllWatchedButton"
                    style="@style/film_all_button"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/film_collection_view_button_all" />
            </LinearLayout>

            <androidx.recyclerview.widget.RecyclerView
                android:id="@+id/watchedCollectionRecyclerView"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />

            <TextView
                style="@style/film_category_name"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:ellipsize="end"
                android:maxLines="1"
                android:text="@string/profile_fragment_collections" />

            <LinearLayout
                android:id="@+id/createNewCollection"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/_6sdp"
                android:orientation="horizontal">

                <ImageView
                    android:id="@+id/collectionImageView"
                    style="@style/film_category_name"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center"
                    android:layout_weight="1"
                    android:src="@drawable/ic_plus"
                    app:layout_constraintBottom_toBottomOf="@id/collectionNameTextView"
                    app:layout_constraintEnd_toStartOf="@id/collectionNameTextView"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toTopOf="@id/collectionNameTextView" />

                <TextView
                    android:id="@+id/collectionNameTextView"
                    style="@style/film_category_name"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center"
                    android:layout_marginStart="@dimen/_6sdp"
                    android:layout_weight="3"
                    android:ellipsize="end"
                    android:maxLines="1"
                    android:text="@string/dialog_create_new_collection"
                    app:layout_constraintBottom_toTopOf="@id/divider"
                    app:layout_constraintEnd_toStartOf="@id/collectionCountTextView"
                    app:layout_constraintStart_toEndOf="@id/collectionImageView"
                    app:layout_constraintTop_toTopOf="parent" />
            </LinearLayout>

            <androidx.recyclerview.widget.RecyclerView
                android:id="@+id/collectionRecyclerView"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
                app:spanCount="2" />

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal">

                <TextView
                    style="@style/film_category_name"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="3"
                    android:ellipsize="end"
                    android:maxLines="1"
                    android:text="@string/profile_history" />

                <Button
                    android:id="@+id/showAllHistoryButton"
                    style="@style/film_all_button"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/film_collection_view_button_all" />
            </LinearLayout>

            <androidx.recyclerview.widget.RecyclerView
                android:id="@+id/historyCollectionRecyclerView"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
        </LinearLayout>
    </androidx.core.widget.NestedScrollView>
</FrameLayout>